package com.generator.constant;

import java.util.HashMap;
import java.util.Map;


public class MysqlJavaTypeParam {

    private static Map<String,String> param = new HashMap<String, String>(){{
        //mysql类型与java类的类型对应
        put("TINYINT","Integer");
        put("SMALLINT","Integer");
        put("MEDIUMINT","Integer");
        put("INT","Integer");
        put("INTEGER","Integer");
        put("BIGINT","Long");
        put("REAL","Float");
        put("FLOAT","Float");
        put("DOUBLE","Double");
        put("DECIMAL","BigDecimal");

        put("CHAR","String");
        put("VARCHAR","String");
        put("TINYTEXT","String");
        put("TEXT","String");
        put("MEDIUMTEXT","String");
        put("LONGTEXT","String");

        put("DATE","Date");
        put("DATETIME","Date");
        put("TIMESTAMP","Date");
    }};

    public static String get(String key){
        return param.get(key.toUpperCase());
    }

}
